package io;

import java.io.*;

/**
 * @Author admin
 * @Date 2019/4/12 8:11
 */
public class T2 {
    public static void main(String[] args) {
        Reader in=null;
        BufferedReader br=null;
        Writer out=null;
        BufferedWriter bw=null;
        try {
            in=new FileReader("1.txt");
            br=new BufferedReader(in);
            out=new FileWriter("D:\\1.txt");
            bw=new BufferedWriter(out);

            String line=null;

            while ((line=br.readLine())!=null){
                bw.write(line);
            }
            bw.flush();
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                if (br != null) {
                    br.close();
                }
                if (in != null) {
                    in.close();
                }
                if (bw != null) {
                    bw.close();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
